package study.springboot.starter.redis.redisson;

import org.redisson.api.RList;
import org.redisson.api.RLock;
import org.redisson.api.RMap;
import org.redisson.api.RReadWriteLock;
import org.redisson.api.RSet;
import org.redisson.api.RedissonClient;

public class RedissonXClient {

    private RedissonClient redissonClient;

    public RedissonXClient(RedissonClient redissonClient) {
        this.redissonClient = redissonClient;
    }

    /**
     * RList
     */
    public <V> RList<V> getList(String key) {
        return redissonClient.getList(key);
    }

    /**
     * RMap
     */
    public <V> RMap<String, V> getMap(String key) {
        return redissonClient.getMap(key);
    }

    /**
     * RSet
     */
    public <V> RSet<V> getSet(String key) {
        return redissonClient.getSet(key);
    }

    /**
     * 锁
     */
    public RLock getLock(String key) {
        return redissonClient.getLock(key);
    }

    public RReadWriteLock getReadWriteLock(String key) {
        return redissonClient.getReadWriteLock(key);
    }
}
